<template>
	<view class="bg-container">
		<view class="container">
			<img :src="imageUrl" style="width:100%"/>
			<!-- <img src="@/static/imgs/invite-bg.png" style="width:100%;height:auto"/>
			<img :src="avatar" style="position: absolute;top: 120rpx;left: 50%;margin-left:-120rpx;width: 240rpx;height: 240rpx;border-radius:50%"/>
			<img :src="ercode" style="position: absolute;bottom: 360rpx;left: 50%;margin-left:-120rpx;width: 240rpx;height: 240rpx;" @click="showCode"/> -->
			<!-- {{userInfo}} -->
		</view>
	</view>
</template>

<script>
	export default{
		onLoad() {
			this.userInfo=JSON.parse(uni.getStorageSync("userInfo")||"{}");
			this.ercode+= encodeURIComponent(window.location.origin+"#/pages/public/register?puid=" +this.userInfo.StoreUserInfo.Uid);
			
			this.imageUrl=this.$config.API_URL+"Distribute/InviteUser?puid="+this.userInfo.StoreUserInfo.Uid+"&url="+encodeURIComponent(window.location.origin);
			
			let avatar="";
			if(this.userInfo&&this.userInfo.StoreUserInfo){
				avatar=this.userInfo.StoreUserInfo.Avatar;
			}
			this.avatar=this.$config.EOS_BASE+"/server/file/get?guid="+avatar;
			
		},
		data(){
			return {
				config:this.$config,
				ercode:this.$config.API_URL+'/ERCode/Create?text=',
				userInfo:{},
				avatar:"",
				imageUrl:""
			}
		},
		methods:{
			showCode(){
				window.open(window.location.origin+"#/pages/public/register?puid=" +this.userInfo.StoreUserInfo.Uid);
			}
		}
	}
</script>

<style scope="scoped" lang="scss">
	.bg-container{
		width:100%;
		height:100%;
		background-color:#d2b482;
		display:flex;
		flex-direction:column;
		align-items:center;
		justify-content:flex-start;
		
	}
	
	.container{
		width:100%;
		display:inline-block;
		position:relative;
		// overflow:hidden;
		z-index:100;
		
		&.container-1{
			height:400rpx;
			background-color:rgb(240,199,135);
		}		
		
		
		
	}
	
</style>
